from common import create_authorization
import requests

def channel_request(startTime,endTime,channel,attState):
    param = f"?startTime={startTime}&endTime={endTime}&channel={channel}&attState={attState}"
    url = f"/api/channel/shipment/barcodes"
    #URL = f"http://localhost:8080{url}{param}"
    URL = f"https://dongting.haishenxiyi.cn{url}{param}"
    #URL = f"https://qzlssj.haishenxiyi.net{url}{param}"
    header = create_authorization("GET",url, "RIKbrKpGiOgN", "Ji0j14QVw9sft7lwKh2LkAPN77g0kXFi")
    #header = create_authorization("GET", url, "CwTtrGXGA8b8", "2vMnXbDUnb9cSVdR10wtgAvLzF5gwewy")
    headers = {
        'Authorization': header,
        'Content-Type': 'application/json'
    }
    print(URL)
    print(headers)
    response = requests.get(URL,headers=headers)
    print("Status Code:", response.status_code)
    print("Response Text:", response.text)

channel_request("2024-04-01 15:09:00","2024-04-12 16:59:59","","true")